import functools,threading
import time

def debounce(delay:int):
    def wrapper(func):
        last_call=-1
        @functools.wraps(func)
        def call(*args,**kwargs):
            nonlocal last_call
            gap=time.time()-last_call
            if gap>delay:
                func(*args,**kwargs)
                last_call=time.time()
        return call

    return wrapper


